using micromsg;
using MicroMsg.Common.Event;
using MicroMsg.Common.Utils;
using MicroMsg.Protocol;
using System;
namespace MicroMsg.Scene
{
	public class NetSceneLogOutWebWx : NetSceneBaseEx<LogOutWebWxRequest, LogOutWebWxResponse, LogOutWebWxRequest.Builder>
	{
		private const string TAG = "NetSceneLogOutWebWx";
		public bool doScene(MMLogoutWebWxOpcode opcode)
		{
			base.beginBuilder();
			this.mBuilder.BaseRequest = NetSceneBase.makeBaseRequest(0);
			this.mBuilder.OpCode = (uint)opcode;
			this.mSessionPack.mCmdUri = "/cgi-bin/micromsg-bin/logoutwebwx";
			this.mSessionPack.mConnectMode = 2;
			base.endBuilder();
			return true;
		}
		protected override void onFailed(LogOutWebWxRequest request, LogOutWebWxResponse response)
		{
			Log.smethod_1("NetSceneLogOutWebWx", "send request failed");
			EventCenter.postEvent(EventConst.ON_NETSCENE_LOGOUT_WEBWX_ERR, RetConst.MM_ERR_CLIENT, null);
		}
		protected override void onSuccess(LogOutWebWxRequest request, LogOutWebWxResponse response)
		{
			RetConst ret = (RetConst)response.BaseResponse.Ret;
			if (ret != RetConst.MM_OK)
			{
				Log.smethod_1("NetSceneLogOutWebWx", "send request failed ret =" + ret);
				EventCenter.postEvent(EventConst.ON_NETSCENE_LOGOUT_WEBWX_ERR, ret, null);
				return;
			}
			EventCenter.postEvent(EventConst.ON_NETSCENE_LOGOUT_WEBWX_SUCCESS, ret, null);
		}
	}
}
